# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
pkgname=kdeplasma-addons
pkgver=5.27.10
pkgrel=0
pkgdesc="All kind of addons to improve your Plasma experience"
# armhf blocked by qt5-qtdeclarative
# ppc64le, s390x and riscv64 blocked by qt5-qtwebengine
arch="all !armhf !ppc64le !s390x !riscv64"
url="https://kde.org/plasma-desktop/"
license="LGPL-2.0-only AND GPL-2.0-or-later"
depends="purpose5"
depends_dev="
	icu-dev
	karchive5-dev
	kcmutils5-dev
	kconfig5-dev
	kcoreaddons5-dev
	kdeclarative5-dev
	kholidays5-dev
	ki18n5-dev
	kiconthemes5-dev
	kio5-dev
	knewstuff5-dev
	knotifications5-dev
	kross-dev
	krunner5-dev
	kservice5-dev
	kunitconversion5-dev
	kwindowsystem5-dev
	networkmanager-qt5-dev
	plasma-framework5-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtwebengine-dev
	sonnet5-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
_repo_url="https://invent.kde.org/plasma/kdeplasma-addons.git"
source="https://download.kde.org/$_rel/plasma/$pkgver/kdeplasma-addons-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# converterrunnertest is broken
	# datetimerunnertest requires running Wayland session
	xvfb-run ctest --test-dir build --output-on-failure -E "(converterrunner|datetimerunner)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
ecb13f4b1bf5b6e144dbc813a30cc67fce0c33b366c37c9b4c954a22adb4d92f44dbcdda34b62f191384d368cad7438f82212c05c5e55ea90c7a24b21f641016  kdeplasma-addons-5.27.10.tar.xz
"
